package com.ler.yrmall.product.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ler.yrmall.basic.BaseAssignKey;
import com.ler.yrmall.enums.BasicStatusEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * @author Leron
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "pms_spu_attr_value",autoResultMap = true)
public class SpuAttrValueEntity extends BaseAssignKey<SpuAttrValueEntity> {

    /**
     * id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * spuId
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long spuId;

    /**
     * attrId
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long attrId;

    /**
     * 属性名称
     */
    private String attrName;

    /**
     * 属性值
     */
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String> attrValue;

    /**
     *  属性排序
     */
    private Integer sort;

    /**
     * 是否快速展示
     * @see BasicStatusEnum.SystemEnableStatus
     */
    private Integer quickShow;

}
